package com.mobile.collect.activitys;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;

import com.mobile.collect.R;
import com.mobile.collect.utils.Camera2Manager;
import com.mobile.collect.view.AutoFitTextureView;

/**
 * @date 2019-10-29
 */

public class Camera2Activity extends Activity implements View.OnClickListener {
    private AutoFitTextureView mTextureView;
    private ImageButton mTakePictureBtn;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_camera2);
        Camera2Manager.getInstance().init(this);
        initViews();
        init();
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Camera2Manager.getInstance().destroy();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.camera_take_picture:
                break;
        }
    }

    private void initViews() {
        mTextureView = findViewById(R.id.camera_texture);
        mTakePictureBtn = findViewById(R.id.camera_take_picture);
        mTakePictureBtn.setOnClickListener(this);
    }

    private void init() {

    }
}
